package zb.blog.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import zb.blog.base.bean.Result;
import zb.blog.service.IPraiseService;

import javax.servlet.http.HttpServletRequest;

/**
 * @Author: BinZhang
 * @Date: 2018/5/1 15:24
 * @Description:赞相关
 */
@Controller
@RequestMapping("/praise")
public class PraiseController {

    @Autowired
    private IPraiseService iPraiseService;

    @RequestMapping("/addPraise")
    @ResponseBody
    public Result addPraise(String artId, Integer praiseId, Integer type, HttpServletRequest request) {
        return iPraiseService.addPraise(artId, praiseId, type, request);
    }

    @RequestMapping("/getPraiseByArtId")
    @ResponseBody
    public Result getPraiseByArtId(String artId, Integer type) {
        return iPraiseService.getPraiseByArtId(artId, type);
    }
}
